package org.huzhp.console.controller;


import org.huzhp.console.service.IConsoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("api")
public class ApiController {


    @Autowired
    private IConsoleService consoleService;


    @GetMapping("routes")
    @ResponseBody
    public List routes() {
        return consoleService.getAllRoutes();
    }

    @GetMapping("rules")
    @ResponseBody
    public List rules() {
        return consoleService.getAllRules();
    }
}
